/**
 * Created by zhulingxiao on 2017/6/7.
 */
import { connect } from 'react-redux';

import User from '../../pages/User/index';

// import { openModal, closeModal } from '../../redux/actions/updateModal';

import { userFetch } from '../../redux/actions/user'

const mapStateToProps = (state) => {

  return {
    tableLoading:state.table.loading,
    // modalLoading:state.modal.loading,
    // visible:state.modal.visible,
    // modalData:state.modal,
    userList:state.user.data
  }
};

const mapDispatchToProps = (dispatch) => {

  return {

    onFetch: (cb) => {
      dispatch(userFetch(cb))
    }

    // openModal:( title, parentid, link, icon, qx, index, sysid ) => {
    //   dispatch(openModal(title, parentid, link, icon, qx, index, sysid))
    // },

    // closeModal:() => {
    //   dispatch(closeModal())
    // },

    // deleteMenu:(sysid) => {
    //   dispatch(menuDelete(sysid))
    // },

    // updateMenu:(data) => {

    //   dispatch(menuUpdate(data));

    //   dispatch(closeModal());

    // },

    // addMenu:(data) => {

    //   dispatch(menuAdd(data))

    // }

  }

};

const Con_UserList= connect(
  mapStateToProps,
  mapDispatchToProps
)(User);

export default Con_UserList

